home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / SampleTemplate / Sample Template / Source / AlbumCode1Page2.r < prev    next >
Encoding:
Text File  |  1993-09-07  |  11.1 KB  |  331 lines  |  [TEXT/MPS ]

  1. #include "Types.r"
  2. #include "OCETemplates.h"
  3. #include "OCE.r"
  4. #include "Track.h"
  5. #include "Album.h"
  6.  
  7.  
  8. /////////////////////////////////////////////////////////////////////////
  9. //
  10. // BOOKKEEPING - this is an aspect template with this base resource id
  11. //
  12. /////////////////////////////////////////////////////////////////////////
  13.  
  14. #define kAlbum2ndInfoPageAspect        kDETThirdID
  15.  
  16. resource 'deta' (kAlbum2ndInfoPageAspect, purgeable) {
  17.     0,                    // Drop priority
  18.     dropCheckAlways,    // Drop check flag
  19.     notMainAspect        // Not the main aspect
  20. };
  21.  
  22. resource 'rstr' (kAlbum2ndInfoPageAspect+kDETTemplateName, purgeable) {
  23.     "Album Second Info Page Aspect"
  24. };
  25.  
  26.  
  27.  
  28. /////////////////////////////////////////////////////////////////////////
  29. //
  30. // BINDING - associate this aspect with records of this type
  31. //
  32. /////////////////////////////////////////////////////////////////////////
  33.  
  34. resource 'rstr' (kAlbum2ndInfoPageAspect+kDETRecordType, purgeable) {
  35.     "Album"
  36. };
  37.  
  38.  
  39. // Icons
  40. include "AlbumIcons" 'ICN#'(0) as 'ICN#'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  41. include "AlbumIcons" 'icl4'(0) as 'icl4'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  42. include "AlbumIcons" 'icl8'(0) as 'icl8'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  43.  
  44.  
  45. // Code
  46. include "Album1Code" 'detc'(0) as 'detc'(kAlbum2ndInfoPageAspect+kDETAspectCode, purgeable);
  47.  
  48.  
  49. //----------------------------------------------------------------------
  50. //
  51. // Lookup resource - what attributes to lookup,
  52. //                     how to assign them to properties
  53. //
  54. //----------------------------------------------------------------------
  55.  
  56. resource 'dett' (kAlbum2ndInfoPageAspect+kDETAspectLookup, purgeable) {
  57.     {
  58.     {"Album Track Info"}, typeBinary,
  59.         useForInput, useForOutput, notInSublist, isNotAlias, isNotRecordRef,
  60.         {
  61.             'long', prPlayingTimeHours, 0;
  62.             'long', prPlayingTimeMinutes, 0;
  63.             'long', prPlayingTimeSeconds, 0;
  64.         };
  65.         
  66.     {"Track"}, typeBinary,
  67.         notForInput, notForOutput, useInSublist, isNotAlias, isNotRecordRef,
  68.         {};
  69.     }
  70. };
  71.  
  72.  
  73. //----------------------------------------------------------------------
  74. //
  75. // Drag and Drop Information
  76. //
  77. //----------------------------------------------------------------------
  78.  
  79. resource 'rstr' (kAlbum2ndInfoPageAspect+kDETAspectDragInString, purgeable) {
  80.     "Do you want to add %3%“^3”%the selected items% to the track address list of *0x/the/* ^1 “^2”?"
  81. };
  82.  
  83. resource 'rst#' (kAlbum2ndInfoPageAspect+kDETAspectAttrDragIn, purgeable) {
  84.     {
  85.     "", "Track", "Track"
  86.     }
  87. };
  88.  
  89.  
  90. //----------------------------------------------------------------------
  91. //
  92. // Sublist Sorting Information
  93. //
  94. //----------------------------------------------------------------------
  95.  
  96. resource 'detm' (kAlbum2ndInfoPageAspect+kDETAspectViewMenu, purgeable) {
  97.     kAlbum2ndInfoPageAspect+kDETAspectViewMenu,
  98.     {
  99.     kDETAspectName,            "by Title";
  100.     -prTrackNumber,            "by Track Number";
  101.     }
  102. };
  103.  
  104. resource 'detp' (kAlbum2ndInfoPageAspect+kDETAspectReverseSort, purgeable) {
  105.     {
  106.     prTrackNumber
  107.     }
  108. };
  109.  
  110.  
  111.  
  112. //----------------------------------------------------------------------
  113. //
  114. // Balloon help for the properties
  115. //
  116. //----------------------------------------------------------------------
  117.  
  118. resource 'rst#' (kAlbum2ndInfoPageAspect+kDETAspectBalloons,purgeable) {
  119.     {
  120.     "The number of tracks on the album.",            "The number of tracks on the album. Uneditable because the record is locked or access controled.",
  121.     "The number of hours of music on the album.",    "The number of hours of music on the album. Uneditable because the record is locked or access controled.",
  122.     "The number of minutes of music on the album.",    "The number of minutes of music on the album. Uneditable because the record is locked or access controled.",
  123.     "The number of seconds of music on the album.",    "The number of seconds of music on the album. Uneditable because the record is locked or access controled.",
  124.     }
  125. };
  126.  
  127.  
  128.  
  129. // --------------------------------------------------------------------
  130. // --------------------------------------------------------------------
  131. //
  132. // Album Information Page
  133. //
  134. // --------------------------------------------------------------------
  135. // --------------------------------------------------------------------
  136.  
  137.  
  138. /////////////////////////////////////////////////////////////////////////
  139. //
  140. // BOOKKEEPING - this is an information page template with this base resource id
  141. //                 and this view
  142. //
  143. /////////////////////////////////////////////////////////////////////////
  144.  
  145. #define kAlbum2ndInfoPage            kDETFourthID
  146.  
  147. #define kTitleTop                    (85)
  148. #define kTitleBottom                (kTitleTop+12)
  149. #define kSublistTop                    (kTitleBottom+2)
  150. #define kSublistBottom                (kDETRecordInfoWindHeight-40)
  151. #define kSublistLeft                (12)
  152. #define kSublistRight                (kDETRecordInfoWindWidth-12)
  153.  
  154. resource 'deti' (kAlbum2ndInfoPage, purgeable) {
  155.     2000,
  156.     {kSublistTop, kSublistLeft, kSublistBottom, kSublistRight},
  157.     selectFirstText, 
  158.     {
  159.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage;
  160.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 1;
  161.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 2;
  162.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 3;
  163.     },
  164.     {
  165.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 4;
  166.     }
  167. };
  168.  
  169. resource 'rstr' (kAlbum2ndInfoPage+kDETTemplateName, purgeable) {
  170.     "Album 2nd Info Page"
  171. };
  172.  
  173. resource 'rstr' (kAlbum2ndInfoPage+kDETInfoPageName, purgeable) {
  174.     "Track Info"
  175. };
  176.  
  177.  
  178. /////////////////////////////////////////////////////////////////////////
  179. //
  180. // BINDING - associate this information page with records of this type
  181. //             and with this aspect
  182. //
  183. /////////////////////////////////////////////////////////////////////////
  184.  
  185. resource 'rstr' (kAlbum2ndInfoPage+kDETRecordType, purgeable) {
  186.     "Album"
  187. };
  188.  
  189. resource 'rstr' (kAlbum2ndInfoPage+kDETInfoPageMainViewAspect, purgeable) {
  190.     "Album Second Info Page Aspect"
  191. };
  192.  
  193.  
  194. /////////////////////////////////////////////////////////////////////////
  195. //
  196. // VIEWS - what you see in this information page
  197. //
  198. /////////////////////////////////////////////////////////////////////////
  199.  
  200.  
  201. #define kMyFirstColumnLeft                (55)
  202. #define kMyFirstColumnRight                (kMyFirstColumnLeft + 120)
  203. #define kEditTextWidth                    (23)
  204. #define kSpaceBeforeEditDesc            (25)
  205. #define kNumEditColumns                    (3)
  206. #define kMyEditColumnWidth                (70)
  207. #define k1stEditColumnLeft                (kMyFirstColumnRight + 2)
  208. #define k2ndEditColumnLeft                (k1stEditColumnLeft + kMyEditColumnWidth)
  209. #define k3rdEditColumnLeft                (k2ndEditColumnLeft + kMyEditColumnWidth)
  210. #define k4thEditColumnLeft                (k3rdEditColumnLeft + kMyEditColumnWidth)
  211.  
  212. #define kNumTracksTop                    (40)
  213. #define kNumTracksBottom                (kNumTracksTop + kDETAppFontLineHeight + 4)
  214. #define kPlayingTimeTop                    (kNumTracksBottom + 4)
  215. #define kPlayingTimeBottom                (kPlayingTimeTop + kDETAppFontLineHeight + 4)
  216. #define k2ndColumnRightInset            (kDETRecordInfoWindWidth - 10)
  217.  
  218. #define kButtonTop        (kSublistBottom+15)
  219. #define kButtonBottom    (kButtonTop+16)
  220. #define kOpenLeft        62
  221. #define kOpenRight        112
  222. #define kAddLeft        208
  223. #define kAddRight        258
  224. #define kRemoveLeft        270
  225. #define kRemoveRight    320
  226.  
  227. #define kIconLeft        2
  228. #define kNameLeft        22
  229. #define kTrackNumberLeft        162
  230. #define kPrefLeft        285
  231. #define kPrefRight        305
  232.  
  233. #define kIconEntryTop        -7
  234. #define kIconEntryBottom    9
  235. #define kEntryTop            -5
  236. #define kEntryBottom        9
  237.  
  238. resource 'detv' (kAlbum2ndInfoPage, purgeable) {
  239.     {
  240.     kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
  241.     Bitmap { kDETLargeIcon };
  242.     }
  243. };
  244.  
  245. resource 'detv' (kAlbum2ndInfoPage + 1, purgeable) {
  246.     {
  247.     {kNumTracksTop, kMyFirstColumnLeft, kNumTracksBottom, kMyFirstColumnRight}, kDETNoFlags, kDETNoProperty,
  248.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  249.         "Number of tracks:" };
  250.  
  251.     {kNumTracksTop, k1stEditColumnLeft, kNumTracksBottom, k1stEditColumnLeft + kEditTextWidth}, kDETNoFlags, prNumTracks,
  252.     StaticText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  253.     }
  254. };
  255.  
  256. resource 'detv' (kAlbum2ndInfoPage + 2, purgeable) {
  257.     {
  258.     {kPlayingTimeTop, kMyFirstColumnLeft, kPlayingTimeBottom, kMyFirstColumnRight}, kDETNoFlags, kDETNoProperty,
  259.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  260.         "Total playing time:" };
  261.  
  262.     {kPlayingTimeTop-2, k1stEditColumnLeft, kPlayingTimeBottom-2, k1stEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeHours,
  263.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  264.  
  265.     {kPlayingTimeTop, k1stEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k2ndEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  266.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  267.         "Hours" };
  268.  
  269.     {kPlayingTimeTop-2, k2ndEditColumnLeft, kPlayingTimeBottom-2, k2ndEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeMinutes,
  270.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  271.  
  272.     {kPlayingTimeTop, k2ndEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k3rdEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  273.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  274.         "Minutes" };
  275.  
  276.     {kPlayingTimeTop-2, k3rdEditColumnLeft, kPlayingTimeBottom-2, k3rdEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeSeconds,
  277.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  278.  
  279.     {kPlayingTimeTop, k3rdEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k4thEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  280.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  281.         "Seconds" };
  282.     }
  283. };
  284.  
  285. resource 'detv' (kAlbum2ndInfoPage + 3, purgeable) {
  286.     {
  287.     {kSublistTop-1, kSublistLeft-1, kSublistBottom+1, kSublistRight+1}, kDETNoFlags, kDETNoProperty,
  288.         Box { kDETUnused };
  289.  
  290.     {kTitleTop, kSublistLeft+kNameLeft, kTitleBottom, kSublistLeft+kTrackNumberLeft-2},
  291.         kDETNoFlags, kDETAspectName,
  292.         StaticCommandTextFromView { kDETDefaultFont, kDETDefaultFontSize, kDETLeft, kDETUnderline, "Title",
  293.                         kDETChangeViewCommand, -1 };
  294.  
  295.     {kTitleTop, kSublistLeft+kTrackNumberLeft, kTitleBottom, kSublistLeft+kPrefLeft-2},
  296.         kDETNoFlags, prTrackNumber,
  297.         StaticCommandTextFromView { kDETDefaultFont, kDETDefaultFontSize, kDETLeft, kDETNormal, "Track Number",
  298.                         kDETChangeViewCommand, -2 }; 
  299.  
  300.     {kButtonTop, kOpenLeft, kButtonBottom, kOpenRight}, 
  301.         kDETNoFlags, kDETOpenSelectedItems,
  302.         Button { kDETApplicationFont, 10,  kDETCenter, kDETNormal, "Open", kDETOpenSelectedItems };
  303.  
  304.     {kButtonTop, kAddLeft, kButtonBottom, kAddRight}, 
  305.         kDETNoFlags, kDETAddNewItem,
  306.         Button { kDETApplicationFont, 10, kDETCenter, kDETNormal, "Add…", kDETAddNewItem };
  307.  
  308.     {kButtonTop, kRemoveLeft, kButtonBottom, kRemoveRight}, 
  309.         kDETNoFlags, kDETRemoveSelectedItems,
  310.         Button { kDETApplicationFont, 10, kDETCenter, kDETNormal, "Remove", kDETRemoveSelectedItems };
  311.     }
  312. };
  313.  
  314.  
  315. resource 'detv' (kAlbum2ndInfoPage + 4, purgeable) {
  316.     {
  317.     {kIconEntryTop, kIconLeft, kIconEntryBottom, kNameLeft-4},
  318.         kDETHilightIfSelected, kDETAspectMainBitmap,
  319.         Bitmap { kDETMiniIcon };
  320.  
  321.     {kEntryTop, kNameLeft, kEntryBottom, kTrackNumberLeft-2},
  322.         kDETHilightIfSelected + kDETDynamicSize, kDETAspectName,
  323.         EditText { kDETDefaultFont, kDETDefaultFontSize, kDETLeft, kDETNormal };
  324.  
  325.     {kEntryTop, kTrackNumberLeft, kEntryBottom, kPrefLeft-2},
  326.         kDETHilightIfSelected + kDETDynamicSize, prTrackNumber,
  327.         EditText { kDETDefaultFont, kDETDefaultFontSize, kDETLeft, kDETNormal };
  328.     }
  329. };
  330.  
  331.